#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
using namespace std;

/**
 * 这题做了好长时间
 * 原因是理解错了题意
 * 雷达的位置不要定要为整数
 * 一直以为雷达的位置要为整数
 * 所以导致错误
 *
 */

//#define DEBUG
const double EPS = 1e-7;

vector<pair<double, double> > islands;
int n, d;

bool mycompare(const pair<double, double>& i, const pair<double, double>& j)
{ 
    return (i.first < j.first); 
}

int FindSolution() {
    sort(islands.begin(), islands.end(), mycompare);
#ifdef DEBUG
    vector<pair<double, double> >::iterator it;
    for (it = islands.begin(); it != islands.end(); it++) {
        cout << (*it).first << " " << (*it).second << endl;;
    }
#endif

    int l; 
    double left, right;
    int x, y;
    int RadarCount = 0;

    n = islands.size();

    for (int nth = 0; nth < n; ) {
        left = islands[nth].first;
        right = islands[nth].second;
        RadarCount++;
        nth++;

        for (int k = nth; k < n; ++k) {
            if (islands[k].first > right) {
                break;
            }
            else {
                left = max<double>(left, islands[k].first);
                right = min<double>(right, islands[k].second);
                nth++;
            }
        }
    }

    return RadarCount;
}

int main() {
    int x, y;
    int t = 1;
    double l;
    bool valid = true;

    while(cin >> n >> d) {
        if (n == 0 && d == 0)
            break;
        valid = true;
        islands.clear();
        for (int i = 0; i < n; ++i) {
            cin >> x >> y;
            if (y > d) valid = false;
            if (valid) {
                l = (double)sqrt((double)(d * d - y * y));
                //cout << "l: " << l << endl;
                islands.push_back(make_pair(x-l, x+l));
            }
        }
        if (!valid)
            cout << "Case " << t++ << ": " << -1 << endl;
        else
            cout << "Case " << t++ << ": " << FindSolution() << endl;
    }
    return 0;
}
